#ifndef BTFORM_H
#define BTFORM_H

#include <QWidget>
#include <QPropertyAnimation>

namespace Ui {
class BtForm;
}

class BtForm : public QWidget
{
    Q_OBJECT

signals:
    void btClick(int id);

public:
    explicit BtForm(QWidget *parent = nullptr);
    ~BtForm();

    void setIconAndText(const QString& pixmap, const QString& text, int pageId);
    // 获取其 pageId 的函数
    int getPageId() const;
    // 改变为背景颜色
    void clearBackgroundColor();
    // 提供给主界面的启动动画的方法
    void showAnimation();

protected:
    void mousePressEvent(QMouseEvent *event);

private:
    Ui::BtForm *ui;
    int pageId;
    QPropertyAnimation* animation1;
    QPropertyAnimation* animation2;
    QPropertyAnimation* animation3;
    QPropertyAnimation* animation4;
};

#endif // BTFORM_H
